package cn.snowheart.learn.mybatis.mapper;

import cn.snowheart.learn.mybatis.entity.Country;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author liuwanxiang
 * @version 2019/04/28
 */
public interface CountryMapper extends Mapper<Country> {

    /**
     * 根据国家名称模糊查询国家信息
     *
     * @param countryName 国家名称
     * @return List<Country>
     */
    @Select("select * from country a where a.countryname like '%' || #{countryName} || '%'")
    List<Country> selectByCountryName(@Param("countryName") String countryName);

}
